package cn.mrlong.tools.bean

import java.sql.Connection


/**
 * @author LeeWyatt
 */
interface NoteDao : CommonDao<Note?> {
    /**
     * @param conn      连接
     * @param chapterId 章节id
     * @return 章节下所有的笔记
     */
    fun findAllByChapterId(conn: Connection?, chapterId: Int?): List<Note?>?

    /**
     * 删除指定章节下的所有笔记
     *
     * @param conn      连接
     * @param chapterId 章节id
     */
    fun deleteAllByChapterId(conn: Connection?, chapterId: Int?)

    /**
     * 删除指定笔记本下的所有笔记
     *
     * @param conn       连接
     * @param notebookId 笔记本id
     */
    fun deleteAllByNotebookId(conn: Connection?, notebookId: Int?)

    /**
     * 获取指定笔记本,指定章节下的全部标题
     *
     * @param conn         连接
     * @param notebookName 笔记本标题
     * @param chapterName  章节标题
     * @return
     */
    fun getTitles(conn: Connection?, notebookName: String?, chapterName: String?): List<String?>?

    /**
     * 根据标题查找
     */
    fun findByTitle(conn: Connection?, noteName: String?, chapterId: Int?): Note?

    fun findByTitles(conn: Connection?, noteTile: String?, chapterTitle: String?, notebookTitle: String?): Note?

    fun getImageRecordsByNotebookId(conn: Connection?, notebookId: Int): List<String?>?

    fun getImageRecordsByChapterId(conn: Connection?, chapterId: Int): List<String?>?

    fun getImageRecordsByNoteId(conn: Connection?, noteId: Int): List<String?>?
}